<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<div data-role="page" id="userCreate_page">
    <div data-role="header">
        <c:if test="${not empty userInfo.id}">
            <h1>User Info</h1>
        </c:if>
        <c:if test="${empty userInfo.id}">
            <h1>User Create</h1>
        </c:if>
    </div>
    <div data-role="content">
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="tor_name" >Nick Name: </label>
            <input type="text" data-clear-btn="true" name="tor_name" id="tor_name" value="<c:out value='${userInfo.name}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="tor_id" >ID : </label>
            <input type="text" data-clear-btn="true" name="tor_id" id="tor_id" value="<c:out value='${userInfo.id}'/>">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="tor_password" >Password : </label>
            <input type="text" data-clear-btn="true" name="tor_password" id="tor_password" value="">
        </div>
        
        <div class="ui-field-contain" style="border-bottom: none;">
            <label for="tor_password_chk" >Password Check : </label>
            <input type="text" data-clear-btn="true" name="tor_password_chk" id="tor_password_chk" value="">
        </div>
        
        <div data-role="controlgroup" data-type="horizontal" align="right">
            <c:if test="${not empty userInfo.id}">
                <button type="button" data-icon="check" data-iconpos="left" data-inline="true" onclick="if($('#tor_name').val() == '' || $('#tor_id').val() == '' || $('#tor_password').val() == ''){    jQuery.mobile.changePage('login.do?method=errorDialog', {type:'post', transition: 'pop', role: 'dialog', data:{errorMessage:'Nick Name, ID, Password는 필수 입력'}});   }else if($('#tor_password').val() != $('#tor_password_chk').val()){    jQuery.mobile.changePage('login.do?method=errorDialog', {type:'post', transition: 'pop', role: 'dialog', data:{errorMessage:'Password, Password Check 입력확인하쑈'}}); }else{    jQuery.mobile.changePage('user.do?method=userUpdate', {type:'post', transition: 'slide', reverse: true, data:{tor_name:$('#tor_name').val(), tor_id:$('#tor_id').val(), tor_password:$('#tor_password').val() }}); }">저장</button>            
            </c:if>
            <c:if test="${empty userInfo.id}">
                <button type="button" data-icon="check" data-iconpos="left" data-inline="true" onclick="if($('#tor_name').val() == '' || $('#tor_id').val() == '' || $('#tor_password').val() == ''){    jQuery.mobile.changePage('login.do?method=errorDialog', {type:'post', transition: 'pop', role: 'dialog', data:{errorMessage:'Nick Name, ID, Password는 필수 입력'}});   }else if($('#tor_password').val() != $('#tor_password_chk').val()){    jQuery.mobile.changePage('login.do?method=errorDialog', {type:'post', transition: 'pop', role: 'dialog', data:{errorMessage:'Password, Password Check 입력확인하쑈'}}); }else{    jQuery.mobile.changePage('user.do?method=userCreate', {type:'post', transition: 'slide', reverse: true, data:{tor_name:$('#tor_name').val(), tor_id:$('#tor_id').val(), tor_password:$('#tor_password').val() }}); }">저장</button>
            </c:if>
            <button type="button" data-icon="back" data-iconpos="left" data-inline="true" onclick="jQuery.mobile.changePage('zHibogo.do?method=list', {type:'post', transition: 'pop', reverse: true});">닫기</button>
        </div>
        
    </div>
</div>